'use strict';

const Controller = require('egg').Controller;
class HomeController extends Controller {
  async index () {
    const { ctx } = this;
    ctx.body = 'hi,egg';
  }
  // 获取四个标签
  async topdata () {
    const data = this.ctx.query;
    const { ctx } = this;
    const res = await ctx.service.home.topdata(data);
    ctx.body = res;
  }
  // 获取四个标签
  async getecharts () {
    const data = this.ctx.query;
    const { ctx } = this;
    const res = await ctx.service.home.getecharts(data);
    ctx.body = res;
  }
  // 获取四个图标
  async getfourecharts () {
    const data = this.ctx.query;
    const { ctx } = this;
    const res = await ctx.service.home.getfourecharts(data);
    ctx.body = res;
  }
  // 订单表最近数据
  async getordertable () {
    const data = this.ctx.query;
    const { ctx } = this;
    const res = await ctx.service.home.getordertable(data);
    ctx.body = res;
  }
}

module.exports = HomeController;
